PSGRIND
Section: User Commands (1)
Index
Return to Main Contents
NAME
psgrind - convert C source files to POSTSCRIPT format for printing
SYNOPSIS
psgrind
[
options
] [
files
]
DESCRIPTION
psgrind
reads in C source files, converts them to POSTSCRIPT format, and spools them for
printing on a POSTSCRIPT printer. The different fonts used for the different
syntactic elements of C source code may be specified on the command line.
Psgrind
is also much faster than any other grind program since it outputs a
direct printer language without going through a normal document formatter
as other pretty source printers must.
The five syntactic categories that
psgrind
recognizes and displays in different ways are page headings (which are
actually not part of the C source code), the ``body'' or main text,
keywords, which are C reserved words, literal strings and comments.
Normally, the heading and keywords are set in a bold Helvetica font,
the comments in a slanted Helvetica font, the body in a normal Helvetica
font and literal strings and character constants in Courier font.
All the above fonts may be changed, see the
-H,
-B,
-K,
-L
and
-C
options.
All these options take as their argument a font specfication.
These font specifications have two parts:
A font name as known to POSTSCRIPT (e.g., Times-Roman, Times-BoldItalic,
Helvetica, Courier), and a
point size (1 point = 1/72 inch-8 point is a good small font).
So ``Courier-Bold8'' is 8 point Courier Bold, ``Helvetica12'' is 12 point
Helvetica.
The environment variable PSGRIND may be used to specify defaults. The
value of PSGRIND is parsed as a string of arguments
before
the arguments
that appear on the command line. For example setting the
environment variable PSGRIND to the string ``-B Times-Roman12''
sets your default body font to 12 point Times Roman.
The possible options are:
- -2
-
Sets two column mode.
- -1
-
Force one column mode.
- -g
-
Causes the fact that a file is garbage to be ignored. Normally, any file
with more than a small number of non-printing characters is suspected of
being garbage, and not printed-this option means ``print it anyway.''
- -o
-
If
psgrind
cannot find characters in a font, the missing characters are listed.
- -p file
-
Causes the POSTSCRIPT file to be written to the named file rather than
being spooled for printing. As a special case,
-p
-
will send the POSTSCRIPT to the standard output.
- -r
-
Causes the output to be rotated 90 degrees on the page (landscape mode).
This is good for output that requires a wide page or for program listings
when used in conjunction with two column mode.
``psgrind -2r
files''
is a nice way to get program listings.
- -R
-
Force portrait (non-rotated) mode.
- -k
-
Enable page prefeed (if the printer supports it). This allows
simple documents (e.g., program listings in one font)
to print somewhat faster by keeping the printer
running between pages.
- -s pagespec
-
Allows you to specify a range (or several ranges) of pages to be printed.
Pagespec
is a string, not containing spaces, of the form ``pagerange[,pagespec]''.
Pagerange
may be a single page number or a range
of the form ``N-M'' which means print pages N through M.
-N means print from the beginning of the docment to page N.
M- means print from page M to the end of the document.
- -H font
-
This allows the respecification of the font used to print running
titles listing the source file name and current page number.
The option argument to
-H,
and the other font options,
should be a font specification as described above.
- -B font
-
This allows one to respecify the font to be used for the main body
of the source, that not set specially in another font.
- -K font
-
This option allows the respecification of the font used to show
keywords as separate from normal body text.
- -L font
-
This option allows the respecification of the font used to show
string and character constants (literals) separate from normal body text.
- -C font
-
This option respecifies the font used to print comment text to
show its separateness from normal text.
The following options are passed on as is to
lpr.
- -Pprinter
-
Causes the output to be sent to the named printer.
- -#n
-
Causes n copies of the output to be produced. The default is one.
- -m
-
Causes the printer daemon to send mail upon job completion.
- -h
-
Suppress the printing of the burst page.
- -J name
-
Set the job name for use on the burst page. Otherwise, the name of the
first input file will be used.
ENVIRONMENT
- PSGRIND
-
string of options to be used by
psgrind.
- METRICS
-
path name of a directory to use instead of
/usr/lib/ps for font metric files.
- PRINTER
-
the name of a printer (as in the
-P
option) for
lpr
to use. If no
-P
option is specified,
lpr
will use this printer. If
-P
is not specified and
PRINTER is not defined in the environment,
psgrind
will spool to a printer named ``PostScript''.
FILES
- /usr/local/lib/ps/*.afm
-
font metrics files.
- /usr/local/lib/ps/psgrind.pro
-
prologue for
psgrind
POSTSCRIPT files.
- lpr
-
Printer spooler
SEE ALSO
enscript(1), lpr(1)
AUTHOR
John Coker,
University of California, Berkeley
This code is based on the
enscript
utility from Adobe Systems, Inc.
BUGS
If you give the
-p
argument after the file to be converted,
psgrind
will lie and tell you that the file has been put in the right
place, when in fact it is in some obscure temporary file. Always give
the
-p
argument first.
Long lines are not truncated in 2 column mode. Line truncation may be
off by a little bit as printer margins vary. There should be a
``wrap'' option and multiple (truncated or wrapped) columns.
Psgrind
generates temporary files which are spooled for printing. The temporary file
names are used by the spooling software (e.g.,
lpq),
rather than the symbolic job name passed to
lpr.
NOTES
POSTSCRIPT is a trademark of Adobe Systems, Incorporated.
Times is a trademark of Allied Corporation.
Helvetica is a registered trademark of Allied Corporation.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- ENVIRONMENT
-
- FILES
-
- SEE ALSO
-
- AUTHOR
-
- BUGS
-
- NOTES
-
This document was created by
man2html,
using the manual pages.
Time: 04:54:19 GMT, January 31, 2023